﻿using StandXunYouServer.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StandXunYouServer.IServices
{
    public interface IAnswerQuestionsServices
    {
        /// <summary>
        /// 随机获取2道题目
        /// </summary>
        /// <returns></returns>
        public Task<IEnumerable<AnswerQuestions>> GetRandomTopicQueryAsync();

        /// <summary>
        /// 检查用户是否答过题了
        /// </summary>
        /// <param name="UserId"></param>
        /// <returns></returns>
        public Task<int> UserIsAnswerAsync(string UserId);

        /// <summary>
        /// 判断用户答对了多少道题目
        /// </summary>
        /// <param name="topicId">题目ID</param>
        /// <param name="topicOption">题目选项</param>
        /// <returns></returns>
        public Task<int> CorrectAnswerAsync(string[] topicId, string[] topicOption);

        /// <summary>
        /// 为用户添加积分
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="points">积分</param>
        /// <returns></returns>
        public Task<bool> UserAddPointsAsync(string userId, int points);

        /// <summary>
        /// 为用户体验记录表中添加数据
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="topicNum">答对题的数量</param>
        /// <param name="points">积分</param>
        /// <returns></returns>
        public Task<bool> InsertReCordAsync(string userId, string topicNum, int points);

        /// <summary>
        /// 修改用户积分并为用户体验记录表中添加数据
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="model"></param>
        /// <returns></returns>
        public Task<bool> UpdateUserPointsAndInsertReCordTranAsync(string userId, int points, ReCord model);
    }
}
